feat(mono): remove sql file & update router with utoipa#1068
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes legacy SQL initialization files and updates the HTTP routers to use Utoipa for OpenAPI generation.
- Deleted SQLite/Postgres init scripts and related README, moving toward SeaORM migrations
- Introduced Utoipa annotations on MR and Issue endpoints and switched to
routes!macro - Updated jupiter storage/init logic and cleaned up SQL file references
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sql/sqlite/sqlite_20241204_init.sql | Removed legacy SQLite init script |
| sql/postgres/pg_20241204__init.sql | Removed legacy Postgres init script |
| sql/README.md | Deleted SQL update guide |
| mono/src/server/https_server.rs | Added ISSUE_TAG constant |
| mono/src/api/mr/mr_router.rs | Refactored MR routes, added Utoipa paths, commented auth |
| mono/src/api/api_router.rs | Changed /create-file from GET to POST |
| jupiter/src/storage/mono_storage.rs | Commented out IsMr filter |
| jupiter/src/storage/init.rs | Removed setup_sql transaction logic |
| jupiter/sqlite_20241204_init.sql | Now empty, previously included external SQL |
| docs/development.md | Removed outdated SQL instructions |
Comments suppressed due to low confidence (8)
jupiter/src/storage/init.rs:54
- The
setup_sqlfunction (and its imports) is commented out but still present. Remove unused code or fully restore it to keep the file clean and ensure initialization logic remains correct.
/// create table from .sql file
jupiter/sqlite_20241204_init.sql:1
- This file is now empty except for a relative path reference. Either restore valid SQL or remove the file reference entirely to avoid initialization errors.
../sql/sqlite/sqlite_20241204_init.sql
docs/development.md:49
- Documentation still outlines manual SQL updates and filename conventions that no longer apply after switching to SeaORM migrations. Update this section to reflect the new migration workflow.
Whenever making any updates to the SQL content
mono/src/api/issue/issue_router.rs:35
- Several new Issue endpoints have been added without accompanying tests. Add unit or integration tests to cover
fetch_issue_list,new_issue, and other handlers to ensure reliability.
async fn fetch_issue_list
mono/src/api/mr/mr_router.rs:64
- You’ve commented out permission checks and hardcoded user values (0, "admin"), effectively disabling auth. Restore proper
LoginUserextraction and permission checks to prevent unauthorized access.
.reopen_mr(mr.into(), 0, "admin")
mono/src/api/api_router.rs:83
- Changing
/create-filefrom GET to POST may break existing clients and docs. Ensure you update documentation and client-side code to match the new method.
post,
jupiter/src/storage/mono_storage.rs:92
- Commenting out the
IsMrfilter means you’ll fetch all refs (including merge requests), which can degrade performance and return unintended data. Re-enable or adjust this filter.
// .filter(mega_refs::Column::IsMr.eq(false))
mono/src/api/issue/issue_router.rs:14
- [nitpick] Importing
SaveCommentRequestfrom themrmodule in the issue router creates cross-module coupling. Consider moving shared types to a common module or defining a dedicated type in the issue API.
use crate::api::mr::{SaveCommentRequest};
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
genedna
approved these changes
May 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.